-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Dealias for unused param check #23256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dealias for unused param check #23256
Conversation
047d302
to
17a1b3f
Compare
@@ -10,7 +10,7 @@ object circelike { | |||
type Configuration | |||
trait ConfiguredCodec[T] | |||
object ConfiguredCodec: | |||
inline final def derived[A](using conf: Configuration)(using inline mirror: Mirror.Of[A]): ConfiguredCodec[A] = // warn // warn | |||
inline final def derived[A](using conf: Configuration)(using inline mirror: Mirror.Of[A]): ConfiguredCodec[A] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These warning seemed valid, neither mirror nor conf is actually used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that a consequence of In addition, take an abstract type as not warnable, unless it has an upper bound that is warnable (has non-universal members).
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Mirror
doesn't have terms to use. Also Of
is an alias so warned previously.
17a1b3f
to
c052463
Compare
Tweaked to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fixes #23250
The check for "unused implicit parameter" considers the type of the parameter, but it should dealias first.
In addition, take an abstract type as not warnable, unless it has an upper bound that is warnable (has non-universal members).
Note that
isSingleton
dealiases.There was an ancient (OG) typo of
&
for&&
which has gone unfixed despite other edits. The right operand was always just an instanceof. Not sure if the previous idiom saves an opcode, but now it looks like other code nearby.